package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model3.OrderDetailsEntity;

public class OrderDetailsAdapter extends AbsRecyclerViewAdapter<OrderDetailsEntity.BodyBean.GuestsBean> {

    public OrderDetailsAdapter(Context context) {
        super(context, R.layout.recycle_order_input_result);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, OrderDetailsEntity.BodyBean.GuestsBean d, int position) {


        if (data.size() > 1) {
            holder.bindTextView(R.id.tv_title, "入住人" + (position + 1));
        } else {
            holder.bindTextView(R.id.tv_title, "入住人");
        }

        holder.bindTextView(R.id.tv_oir_name, d.getName());

        if (d.getIdcard() != null && d.getIdcard().length() != 0) {
            holder.getView(R.id.tv_oir_card).setVisibility(View.VISIBLE);
            holder.bindTextView(R.id.tv_oir_card, d.getIdcard());
        } else {
            holder.getView(R.id.tv_oir_card).setVisibility(View.GONE);
        }

        if (holder.getView(R.id.tv_oir_card).getVisibility() == View.VISIBLE) {
            holder.getView(R.id.vw_oir).setVisibility(View.VISIBLE);
        } else {
            holder.getView(R.id.vw_oir).setVisibility(View.GONE);
        }
    }
}
